# import re
#
# lines = "- 1. 技术评审索引表"
#
# pattern = r"^(\d+(?:\.\d+)*\.?)"  # 匹配 1 或 1.1 或 1.1.1 或 2.1.2.3.（可带最后的点）
# match=re.search(pattern, lines)
# match.group(1)
# print(match.group(1))
#
# results = []
#
# match = re.match(pattern, lines.strip())
# number = match.group(1).rstrip('.')  # 去掉结尾多余的点
# print(number)
# results.append(number)

# for line in lines:
#     match = re.match(pattern, line.strip())
#     if match:
#         number = match.group(1).rstrip('.')  # 去掉结尾多余的点
#         results.append(number)
# print("提取的编号：", results)


import re

text = "1.1 技术评审索引表"
match = re.search(r"\b(\d+(?:\.\d+)*)", text)

if match:
    print("提取的编号:", match.group(1))
else:
    print("未找到编号")

